﻿using System;
using System.Collections.Generic;

namespace _1431_kids_with_the_greatest_number_of_candies
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine ("Hello World!");
        }
        public List<bool> KidsWithCandies(int[] candies, int extraCandies)
        {
            List<bool> kids = new List<bool>();
            int max = candiesMax (candies);
            for (int i = 0; i < candies.Length; i++)
            {
                kids.Add (candies[i] + extraCandies >= max);
            }

            return kids;
        }

        int candiesMax(int[] candies)
        {
            int max = candies[0];
            for (int i = 0; i < candies.Length; i++)
            {
                if (max < candies[i]) max = candies[i];
            }
            return max;
        }
    }

}
